home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / buport.s < prev    next >
Text File  |  1991-11-22  |  2KB  |  109 lines

  1. * BUPORT 1.0 2nov91 phk@data.fls.dk
  2. * ==========
  3. *
  4. * Backup port to remote computer.
  5. *
  6. * ARGS:
  7. *    real    -- Port number
  8. *
  9. * RETURNS:
  10. *    <nothing>
  11. *
  12. * FUNCTION:
  13. *    recals all items in the port, and for each one constructs a new name
  14. *    stores the item in a LAM and uses SEND to transmit it to the remote
  15. *    computer under the new name.  Builds a secondary to pull things back
  16. *    into the calculator.
  17. *
  18. * COPYLEFT:
  19. *    Feel free to use this any way you like, as long as you do give credit
  20. *    where credit is due.
  21. *
  22. ASSEMBLE
  23.     NIBASC /HPHP48-Z/
  24.  
  25. *
  26. * UnDocumented entrypoints.  Picked up from disassembly of Rev.E Firmware:
  27. *
  28. RclPort        EQU    #21922
  29. LibNbr        EQU    #081ee
  30. LibName        EQU    #081d9
  31. xSEND        EQU    #21ef0
  32. xKGET        EQU    #21f24
  33. xSTO        EQU    #20ccd
  34. x>>O        EQU    #23639
  35. x>>I        EQU    #235FE
  36. x->        EQU    #234c1
  37. xQU        EQU    #23654
  38. xUNQU        EQU    #23679
  39. xPURGE        EQU    #20EFE
  40. xSF        EQU    #1C274
  41.  
  42. RPL
  43.     ::
  44.     CK1NOLASTWD
  45.     CK&DISPATCH1
  46.     real
  47.     ::
  48.     THIRTYFIVE TestSysFlag SWAP
  49.     THIRTYFIVE SetSysFlag
  50.     COERCE
  51.     DUP #>$ ".p_" SWAP&$ 1LAMBIND
  52.     RclPort
  53.     DUP ZERO 1GETABND
  54.     ROT
  55.     { LAM guf NULLLAM NULLLAM } BIND
  56.     ' :: x<< % -36 xSF x-> LAM port x<< ; 
  57.     SWAP
  58.     ZERO_DO (DO)
  59.         ::
  60.         SWAP
  61.         DUP ' LAM guf STO
  62.         ::
  63.         CK&DISPATCH1
  64.             #8f ( Library )
  65.             ::
  66.             DUP
  67.             LibName DROP ID>$
  68.             SEVEN SEVEN SUB$ ":" EQUAL ITE
  69.                 ::
  70.                 LibName DROP ID>$
  71.                 DUP " " ONE POS$ DUP#0= ITE
  72.                 DROP
  73.                 :: #1- ONE SWAP SUB$ ;
  74.                 "l_" SWAP&$ ONE EIGHT SUB$ 2GETLAM &$
  75.                 ;
  76.                 ::
  77.                 LibNbr DROP 
  78.                 #2710 #+ #>$ TWO FIVE SUB$
  79.                 "l_" SWAP&$ ONE EIGHT SUB$ 2GETLAM &$
  80.                 ;
  81.             ;
  82.             #9f ( Backup )
  83.             ::
  84.             LibName DROP ID>$
  85.             "b_" SWAP&$ ONE EIGHT SUB$ 2GETLAM &$
  86.             ;
  87.         ;
  88.         DUP
  89.         ' LAM guf SWAP TWO {}N ONE{}N xSEND
  90.         ' ID tmpvar TWO {}N ONE{}N
  91.         ' xKGET 
  92.         ' ID tmpvar
  93.         ' LAM port
  94.         ' xSTO 
  95.         FIVE ::N &COMP
  96.         ;
  97.     LOOP
  98.     ' :: x>>I xQU ID tmpvar xUNQU xPURGE x>>O ; &COMP
  99.     ' LAM guf STO
  100.     { LAM guf }
  101.     THIRTYFIVE ClrSysFlag
  102.     "restore" 2GETLAM &$ >TCOMP ONE{}N xSEND
  103.     ABND
  104.     DROP
  105.     IT
  106.         :: THIRTYFIVE SetSysFlag ;
  107.     ;
  108.     ;
  109.